import { createRouter, createWebHistory } from 'vue-router'
import ConsoleView from '../views/ConsoleView.vue'

const routes = [
  {path: '/home', component: () => import('../views/HomeView.vue')},
  {
    path: '/console',
    name: 'console',
    component: ConsoleView,
    redirect:'/console/user',
    children:[
      {path: '/console/user', component: () => import('../views/user/UserView.vue')},
      {path: '/console/organization', component: () => import('../views/organization/OrganizationView.vue')},
      {path: '/console/audit', component: () => import('../views/organization/OrganizationAuditView.vue')},
      {path: '/console/resource',component: () => import('../views/resource/ResourceView.vue')},
      {path: '/console/authority', component: () => import('../views/authority/AuthorityView.vue')},
      {path: '/console/message', component: () => import('../views/message/MessageHome.vue')},
    ]
  },
  {path: '/', component: () => import('../views/LoginView.vue')},
  {path: '/login', component: () => import('../views/LoginView.vue')},
  {path: '/personalCenter', component: () => import('../views/PersonalCenterView.vue')},
  {path: '/organization', component:() => import('../views/OrganizationView.vue')},
  {path: '/order', component: () => import('../views/OrderView.vue')}
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router
